<div class="row">
<style>
.words{padding-top:7px;}
.locktype{float:left;padding-right:5px; display:block;}
.locktype a{cursor:pointer;}
</style>
     <div class="col-xs-12 col-xs-12">
          <div class="widget radius-bordered">
              <div class="widget-header bg-blue">
				<i class="widget-icon fa fa-arrow-down"></i>
				<span class="widget-caption">加载智能锁</span>
				<div class="widget-buttons">
					<a href="#" data-toggle="maximize">
						<i class="fa fa-expand"></i>
					</a>
					<a href="#" data-toggle="collapse">
						<i class="fa fa-minus"></i>
					</a>
					<a href="#" data-toggle="dispose">
						<i class="fa fa-times"></i>
					</a>
				</div>
			</div>
              <div class="widget-body">
                   <form id="YstechForm" action="" method="post" class="form-horizontal"
                                                  data-bv-message=""
                                                  data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
                                                  data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
                                                  data-bv-feedbackicons-validating="glyphicon glyphicon-refresh">
                  <neq name="cache.id" value=""><input type="hidden" name="rid" value="{$cache.id}"></neq>
                  <div class="form-title">
                        <a href="{:U('Cms/Locks/carrierlockList',array('id'=>$id,'p'=>$p))}" class="btn btn-primary" data-loader="Ystech-loader" data-loadername="加载智能锁">
							<i class="fa fa-mail-reply"></i>返回
						</a>
                   </div>
				   <!--<div class="form-group">
                        <label class="col-lg-2 control-label">载体序列号</label>
                        <div class="col-lg-4 words">
                        <input type="hidden" name="id" class="form-control" value="{$cache.id}">
                        <input type="hidden" name="CarrierId" class="form-control" value="{$cache.SerialNo}">
                        {$cache.SerialNo}
                        </div>
                   </div>-->
				   <input type="hidden" name="CarrierId" class="form-control" value='<neq name="cache.id" value="">{$cache.CarrierId}<else/>{$id}</neq>'>
                   <div class="form-group">
                        <label class="col-lg-2 control-label">名称</label>
                        <div class="col-lg-4 words">
                         {$cache.Name}
                        </div>
                   </div>
                    
                   <div class="form-group">
                        <label class="col-lg-2 control-label">加载智能锁<sup>*</sup></label>
                        <div class="col-lg-4">
                        <neq name="cache.id">
                        <p class="words">{$cache.LockId}【{$LOCKTYPE[$cache['LockType']]}】</p>
                        <else/>
                        <select name="LockId" class="form-control input-sm" data-bv-notempty="true" data-bv-notempty-message="请选择智能锁"><foreach name="lockinfo" item="vo"><option value='{$vo.SerialNo}'>{$vo.SerialNo}【{$LOCKTYPE[$vo['LockType']]}】</option></foreach></select>                   
                        </neq>
                        
                        </div>
                   </div>
				   
                   <div class="form-group">
                        <label class="col-lg-2 control-label">生效日期<sup>*</sup></label>
                        <div class="col-lg-4">
                        <input type="text" id="EffectiveTime" name="EffectiveTime" class="form-control" value="<neq name='cache.EffectiveTime' value=''>{$cache.EffectiveTime|strtotime|date='Y-m-d',###}</neq>" data-bv-notempty="true" data-bv-notempty-message="请选择生效日期">
                        </div>
                   </div>
                   <div class="form-group">
                        <label class="col-lg-2 control-label">结束日期<sup>*</sup></label>
                        <div class="col-lg-4">
                        <input type="text" id="ExpiryTime" name="ExpiryTime" class="form-control" value="<neq name='cache.ExpiryTime' value=''>{$cache.ExpiryTime|strtotime|date='Y-m-d',###}</neq>" data-bv-notempty="true" data-bv-notempty-message="请选择结束日期">
                        </div>
                   </div>
                   
                   <div class="form-group">
                        <label class="col-lg-2 control-label">描述</label>
                        <div class="col-lg-4">
                        <textarea class="form-control" name="Memo">{$cache.Memo}</textarea>
                        </div>
                   </div>
                   
				   <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                             <button class="btn btn-primary btn-lg" type="submit">确定</button>&nbsp;&nbsp;&nbsp;&nbsp;
                             <button class="btn btn-palegreen btn-lg" type="reset">重填</button>&nbsp;&nbsp;&nbsp;&nbsp;
                             
                        </div>
                    </div>
                   </form>
                </div>
        </div>
	</div>
     
</div>
<!--面包屑导航封装-->
<div id="tmpbread" style="display: none;">{$breadhtml}</div>
<script type="text/javascript">
	setBread($('#tmpbread').html());
</script>
<!--/面包屑导航封装-->

<!--表单验证与提交封装-->
<script type="text/javascript">
	
	$('#EffectiveTime').datepicker({format:"yyyy-mm-dd",autoclose:1});
	$('#ExpiryTime').datepicker({format:"yyyy-mm-dd",autoclose:1});
	
	$('#YstechForm').bootstrapValidator({
		submitHandler: function (validator, form, submitButton) {
			
			var callok=function(){
				//成功删除后刷新
				$('#refresh-toggler').trigger('click');
				return false;
			};
           	var tourl="{:U('Cms/Locks/carrier_lock')}";
			var data=$('#YstechForm').serialize();
			$.Ystech.ajax('post',tourl,data,callok);
			return false;
        },
	});
	$('.del').on('click',function(){		
		var toajax="{:U('Cms/Locks/carrierlockDel')}"+"/id/"+$('input[name="id"]').val();
		var funok=function(){
			var callok=function(){
				//成功删除后刷新
				$('#refresh-toggler').trigger('click');
				return false;
			};
			var callerr=function(){
				//拦截错误
				return false;
			};
			$.Ystech.ajax('post',toajax,'nodata',callok,callerr);
		}						
		$.Ystech.confirm("确认要删除吗？",funok);
	});
	
</script>
<!--/表单验证与提交封装-->
